<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>首页</title>
        <link rel="stylesheet" type="text/css"	href="scripts/ext-2.2/resources/css/ext-all.css" />
	    <script type="text/javascript" src="scripts/ext-2.2/adapter/ext/ext-base.js"></script>
	   <script type="text/javascript" src="scripts/ext-2.2/ext-all.js"></script>
	   <script type="text/javascript" src="scripts/ext-2.2/build/locale/ext-lang-zh_CN.js"></script>
	   <script type="text/javascript" src="scripts/ext-2.2/ext-basex.js"></script>
	   <script type="text/javascript" src="scripts/js/ext-extend.js"></script>
	   <script type="text/javascript" src="scripts/ext-2.2/LovCombo.js"></script>
	   <script type='text/javascript' src='scripts/pages/demnew/js/SomWithGrid.js'></script>
	   <script src="scripts/pages/demnew/js/FileUpload.js" type="text/javascript"></script>
	   <style type="text/css">
	      .api-logo{
            	background: url(scripts/images/logo_top.jpg) no-repeat left top;
                font: normal 12px tahoma, arial, verdana, sans-serif;
	            margin: 0;
	            padding: 0;
	            border: 0 none;
	            overflow: hidden;
	            height: 100%;
	            width:100%;
          }
          .api-title{background:url(scripts/images/logo_top-2.jpg) repeat-x}
	   </style>
       <script type="text/javascript">
        Ext.BLANK_IMAGE_URL = 'scripts/ext-2.2/resources/images/default/s.gif';
        var strHref = document.location.toString();
    	function newTab(id,text,url){
			    if(id){
			        var tab = desktop.MainPanel;
			        var n = tab.getComponent('tab_' + id);
			        if(!n){
				        n = tab.add({id:'tab_' + id,title:text,closable : true,html : '<iframe name="frame_' + id + '" id="frame_' + id + '" frameborder="0" width="100%" scrolling="auto" height="100%" src="' + url + '"></iframe>'});
				        var contentPanel = document.getElementById("frame_" + id);
				        if(contentPanel) {
					        contentPanel.src = url;
				        }
				        tab.setActiveTab(n);
			        } else {
				        var contentPanel = document.getElementById("frame_" + id);
				        if(contentPanel) {
					        contentPanel.src = url;
				        }
				        tab.setActiveTab(n);
			        }
		        }
	    };
		function refreshFrame(id,url){
		   var framePanle = document.getElementById(id);
		   framePanle.src = url;
		   
		}
	    function remove(num){
	       var tab = desktop.MainPanel;
		   tab.remove(tab.getActiveTab());
	    }
	    function changeActive(num){
	       var tab = desktop.MainPanel;
		   tab.setActiveTab(num);
	    }
		//根据TABID关闭tab窗口
		function rmvTab(id){
			var tab = desktop.MainPanel;
			if(id){
				var n = tab.getComponent('tab_'+id);
				if(n){
					tab.remove(n);
				}
			}
		}	
		//判断待办页面是否打开
		function checkMyWorkItemShow(applyType){
			var tab = desktop.MainPanel;
			var flag = false;
			if(applyType == 'resApply'){
				if(tab.getItem('tab_myWorkApply')!=undefined){
					flag = true;
				}
			}else if(applyType == 'resAllApply'){
				if(tab.getItem('tab_resAllApply')!=undefined){
					flag = true;
				}			
			}else if(applyType == 'notifyFun'){
				if(tab.getItem('tab_notifyDoneWork')!=undefined){
					flag = true;
				}
			}else{
				if(tab.getItem('tab_myWorkMain')!=undefined){
					flag = true;
				}
			}
			return flag;
		}				    
		Ext.onReady(function(){
			desktop = new ProductHome.Desktop();
			
			
			Ext.lib.Ajax.request(
                    'POST',
                    'empManage.do?method=getEmpInfo',
                    {success: function(response){
                            var user = Ext.decode(response.responseText);
                        	desktop.WestMenu.setTitle('您好：'+user.Name+"，欢迎使用生产门户~~");
                    },failure: function(){
                    }})
             });
			
			//desktop.ppmp_tree.expandAll();
			//desktop.dsgn_tree.expandAll();
			//desktop.req_tree.expandAll();
			
			/**var strHref = document.location.toString();
			if(strHref.indexOf('?')!=-1){
			    strHref = strHref.substr(strHref.indexOf('?')+1,strHref.length-1);
			    var node = desktop.dsgn_tree.getNodeById(strHref);
			    if(node){
    			    desktop.dsgn_tree.selectPath(node.getPath());
	    		    node.fireEvent('click',node);
			    }
			}*/
			
        </script>
    </head>
    <body>
    <div id="title" class="api-title">
      <div id="logo" class="api-logo">
        <div align="right" style='padding-right: 20px;padding-top: 30px'>
            <a href='http://eip.si-tech.com.cn/home.html'>员工门户</a> 
            | <a href='http://172.16.12.7:7001/sso/logout'>注销</a>
        </div> 
      </div>
     <div> 
            <div id="south-div"></div>
    </body>
    <script type="text/javascript" src="desktop.js"></script>
    <script type="text/javascript" src="navgtree.js"></script>
</html>
